package com.wave.spring.dao.jpa;

import com.wave.spring.dto.Person;
import com.wave.spring.jpa.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by lv on 2017/8/27.
 */
public interface PersonRepository extends CustomRepository<Person,Long> {

    List<Person> findByName(String name);

    @Query("select p from Person p where p.name=:name and p.age=:age")
    public Person withNameAndAge(@Param("name") String name,@Param("age") int age);
}
